package com.game.model;

import java.util.HashMap;

import org.apache.mina.core.session.IoSession;

import net.sf.json.JSONObject;

import com.data.model.PlayerDiankong;
import com.dictionary.DictionaryTabel;

public class DeskPlayer extends BasePlayer{
	/** 玩家所在游戏编号 **/
	private int gameNum;
	/** 玩家所在房间编号 **/
	private int roomNum;
	/** 玩家所在桌子编号 **/
	private int deskNum = -1; 
	/** 玩家所在座位编号 **/
	private int seatNum = -1;
	/** 玩家状态 **/
	private int state = DictionaryTabel.player_Idle;
	/** 玩家类型 **/
	private int playerType = DictionaryTabel.PlayerType_People;
	/** 玩家当前boss分 **/
	private long playerNowBossFen = 0;
	public long getPlayerNowBossFen() {
		return playerNowBossFen;
	}

	public void setPlayerNowBossFen(long playerNowBossFen) {
		this.playerNowBossFen = playerNowBossFen;
	}
	/** 总下注金额 **/
	private long totalMoney = 0l;
	/** 上一局总下注金额 **/
	private long preTotalMoney = 0l;
	/** 背包金币 **/
	private long money;
	private PlayerDiankong playerDiankong = null;// 点控信息

	public PlayerDiankong getPlayerDiankong() {
		return playerDiankong;
	}

	public void setPlayerDiankong(PlayerDiankong playerDiankong) {
		this.playerDiankong = playerDiankong;
	}
	/** 下注信息**/
	//private HashMap<Integer, HashMap<Integer, Integer>> betInfo = new HashMap<Integer, HashMap<Integer, Integer>>();
	private HashMap<Integer, Long> betInfo = new HashMap<Integer, Long>();
	/** 上一局下注信息**/
	//private HashMap<Integer, HashMap<Integer, Integer>> preBetInfo = new HashMap<Integer, HashMap<Integer, Integer>>();
	private HashMap<Integer, Long> preBetInfo = new HashMap<Integer, Long>();
	private IoSession session = null; // 玩家连接对象
	public IoSession getSession() {
		return session;
	}
	public void setSession(IoSession session) {
		this.session = session;
	}
	/** 按钮显隐信息 **/
	private int[] chipShow;
	/** 无任何操作局数**/
	private int noOperateCount = 0;
	/**机器人特有-是否被删除**/
	private boolean isDelect = false;
	
	public DeskPlayer(){}	
	public DeskPlayer(JSONObject json){
		JSONObject baseJSON = json.getJSONObject("baseInfo");
		playerId = baseJSON.getLong("playerId");
		nickName = baseJSON.getString("nickName");
		headUrl = baseJSON.getString("headUrl");
		playerSex = baseJSON.getInt("playerSex");
		presentation = baseJSON.getString("presentation");
		JSONObject assistJSON = json.getJSONObject("assistInfo");
		vipLevel = assistJSON.getInt("vipLevel");	
	}
	public int getGameNum() {
		return gameNum;
	}
	public void setGameNum(int gameNum) {
		this.gameNum = gameNum;
	}
	public int getRoomNum() {
		return roomNum;
	}
	public void setRoomNum(int roomNum) {
		this.roomNum = roomNum;
	}
	public int getDeskNum() {
		return deskNum;
	}
	public void setDeskNum(int deskNum) {
		this.deskNum = deskNum;
	}
	public Integer getSeatNum() {
		return seatNum;
	}
	public void setSeatNum(Integer seatNum) {
		this.seatNum = seatNum;
	}
	public int getState() {
		return state;
	}
	public void setState(int state) {
		this.state = state;
	}
	public int getPlayerType() {
		return playerType;
	}
	public void setPlayerType(int playerType) {
		this.playerType = playerType;
	}
	public int getNoOperateCount() {
		return noOperateCount;
	}
	public void setNoOperateCount(int noOperateCount) {
		this.noOperateCount = noOperateCount;
	}
	public boolean isDelect() {
		return isDelect;
	}
	public void setDelect(boolean isDelect) {
		this.isDelect = isDelect;
	}
	public void setSeatNum(int seatNum) {
		this.seatNum = seatNum;
	}
	
	/*public HashMap<Integer, HashMap<Integer,Integer>> getBetInfo() {
		return betInfo;
	}
	public void setBetInfo(HashMap<Integer, HashMap<Integer,Integer>> betInfo) {
		this.betInfo = betInfo;
	}
	public HashMap<Integer, HashMap<Integer,Integer>> getPreBetInfo() {
		return preBetInfo;
	}
	public void setPreBetInfo(HashMap<Integer, HashMap<Integer,Integer>> preBetInfo) {
		this.preBetInfo = preBetInfo;
	}*/
	
	public HashMap<Integer, Long> getBetInfo() {
		return betInfo;
	}
	public void setBetInfo(HashMap<Integer, Long> betInfo) {
		this.betInfo = betInfo;
	}
	public HashMap<Integer, Long> getPreBetInfo() {
		return preBetInfo;
	}
	public void setPreBetInfo(HashMap<Integer, Long> preBetInfo) {
		this.preBetInfo = preBetInfo;
	}
	
	public int[] getChipShow() {
		return chipShow;
	}
	public void setChipShow(int[] chipShow) {
		this.chipShow = chipShow;
	}
	public long getTotalMoney() {
		return totalMoney;
	}
	public void setTotalMoney(long totalMoney) {
		this.totalMoney = totalMoney;
	}
	public long getPreTotalMoney() {
		return preTotalMoney;
	}
	public void setPreTotalMoney(long preTotalMoney) {
		this.preTotalMoney = preTotalMoney;
	}
	public long getMoney() {
		return money;
	}
	public void setMoney(long money) {
		this.money = money;
	}
}
